// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_CHK_QUALITY_CHECKING_ITEM_DETAIL
// * CreateDate    : 2011-11-23 11:20:26
// * Creater       : CodeSmith
// * LastChangeDate: 2011-11-23 11:20:26
// * LastChanger   : 2011-11-23 11:20:26
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ESOL.Common.Entity;
using Suzsoft.Smart.Data;
using System.Data;
using ESOL.Common;

namespace ESOL.Business.Chk
{
/// <summary>
    /// ChkQualityCheckingItemDetail
    /// </summary>
    public partial class ChkQualityCheckingItemDetailBs
    {
        #region GetByID
        /// <summary>
        /// Get Entity
        /// </summary>
        /// <param name="objChkQualityCheckingItemDetailEntity">Entity</param>
        /// <returns>Entity</returns>
        public static ChkQualityCheckingItemDetailEntity GetChkQualityCheckingItemDetail(ChkQualityCheckingItemDetailEntity objChkQualityCheckingItemDetailEntity)
        {
            return DataAccess.SelectSingle<ChkQualityCheckingItemDetailEntity>(objChkQualityCheckingItemDetailEntity);
        }
        #endregion


        #region Insert
        /// <summary>
        /// Insert Data
        /// </summary>
        /// <param name="objChkQualityCheckingItemDetailEntity">Entity</param>
        /// <returns>true Insert Succeed; false Insert Fail</returns>
        public static bool InsertChkQualityCheckingItemDetail(ChkQualityCheckingItemDetailEntity objChkQualityCheckingItemDetailEntity)
        {
            return DataAccess.Insert(objChkQualityCheckingItemDetailEntity);
        }

        public static bool InsertChkQualityCheckingItemDetail(List<ChkQualityCheckingItemDetailEntity> objChkQualityCheckingItemDetailEntityList)
        {
            return DataAccess.Insert(objChkQualityCheckingItemDetailEntityList);
        }
        #endregion


        #region Update
        /// <summary>
        /// Update Data
        /// </summary>
        /// <param name="objChkQualityCheckingItemDetailEntity">Entity</param>
        /// <returns>true Update Succeed; false Update Fail</returns>
        public static bool UpdateChkQualityCheckingItemDetail(ChkQualityCheckingItemDetailEntity objChkQualityCheckingItemDetailEntity)
        {
            return DataAccess.Update(objChkQualityCheckingItemDetailEntity);
        }

        public static bool UpdateChkQualityCheckingItemDetail(List<ChkQualityCheckingItemDetailEntity> objChkQualityCheckingItemDetailEntityList)
        {
            return DataAccess.Update<ChkQualityCheckingItemDetailEntity>(objChkQualityCheckingItemDetailEntityList);
        }
        #endregion


        #region Delete
        /// <summary>
        /// Delete Data
        /// </summary>
        /// <param name="objChkQualityCheckingItemDetailEntity">Entity</param>
        /// <returns>true Delete Succeed; false Delete Fail</returns>
        public static bool DeleteChkQualityCheckingItemDetail(ChkQualityCheckingItemDetailEntity objChkQualityCheckingItemDetailEntity)
        {
            return DataAccess.Delete(objChkQualityCheckingItemDetailEntity);
        }

        public static bool DeleteChkQualityCheckingItemDetail(List<ChkQualityCheckingItemDetailEntity> objChkQualityCheckingItemDetailEntityList)
        {
            return DataAccess.Delete<ChkQualityCheckingItemDetailEntity>(objChkQualityCheckingItemDetailEntityList);
        }
        #endregion


        #region GetAll
        /// <summary>
        /// Get All Data
        /// </summary>
        /// <returns>Back All Data<returns>
        public static DataSet GetChkQualityCheckingItemDetailAll()
        {
            return DataAccess.SelectAllDataSet<ChkQualityCheckingItemDetailEntity>();
        }
        /// <summary>
        /// Get All Data List
        /// </summary>
        /// <returns>Back All Data List<returns>
        public static List<ChkQualityCheckingItemDetailEntity> GetChkQualityCheckingItemDetailAllList()
        {
            return DataAccess.SelectAll<ChkQualityCheckingItemDetailEntity>();
        }
        #endregion

        #region Functions
        public static DataTable GetDtCheckingItemDetailByItemID(string ItemID)
        {
            if (string.IsNullOrEmpty(ItemID))
                return null;
            string Sql = @"SELECT * FROM CHK_QUALITY_CHECKING_ITEM_DETAIL
                WHERE CHECKING_ITEM_ID='" + ItemID + "'";
            DataSet ds = DataAccess.SelectDataSet(Sql);
            if (ds != null && ds.Tables[0] != null)
                return ds.Tables[0];
            else return null;
        }

        public static DataTable GetDtCheckingItemDetailByCondition(string Condition)
        {
            string Sql = @"SELECT * FROM CHK_QUALITY_CHECKING_ITEM_DETAIL WHERE 1=1 ";
            if (!string.IsNullOrEmpty(Condition))
            {
                Sql += Condition;
            }
            DataSet ds = DataAccess.SelectDataSet(Sql);
            if (ds != null && ds.Tables[0] != null)
                return ds.Tables[0];
            else return null;
        }
        #endregion
    }
	
	
}	

